﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SQLite;

namespace _1.test.com
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           //  SQLiteConnection con = new SQLiteConnection("Data Source=;Pooling=true;FailIfMissing=false")
            string _dbPath=Server.MapPath("./data/data.sqlite");
            SQLiteConnection _conn = new SQLiteConnection();
            SQLiteConnectionStringBuilder _connstr = new SQLiteConnectionStringBuilder();

            _connstr.DataSource =  _dbPath;
            _conn.ConnectionString = _connstr.ToString();
            _conn.Open();

            SQLiteDataAdapter _da = new SQLiteDataAdapter("Select ID,title From [table1] limit 50", _conn);
            DataSet _ds = new DataSet("root");
            _da.Fill(_ds, "item");

            DataRow _myRow;
            _myRow = _ds.Tables[0].Rows[0];

            // Response.Write(_myRow["title"]);
            // Response.ContentType = "text/xml";
            // Response.Charset = "utf-8";
            // Response.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            // Response.Write(_ds.GetXml());

            // Response.End();
        }
    }
}